package com.caigou.modules.tools.network.api

import com.caigou.comm.base.bean.HttpResult
import com.caigou.modules.tools.bean.ActiveBean
import com.caigou.modules.tools.bean.CardBean
import com.caigou.modules.tools.bean.RedPackageBean
import com.caigou.modules.tools.bean.UserSignInBean
import kotlinx.coroutines.flow.Flow
import okhttp3.RequestBody
import retrofit2.http.*

/**
 * @author #Suyghur.
 * Created on 2021/09/18
 */
interface HttpToolsApiService {

    /*tool api*/
    @GET("/api/my/card/bag/get/info")
    fun getCardList(@Query("userId") userId: String): Flow<HttpResult<CardBean>>

    @GET("/api/activity/center/get/info")
    fun getActiveInfo(@Query("userId") userId: String): Flow<HttpResult<ActiveBean>>

    @GET("/api/activity/center/user/sign/in")
    fun setUserSignIn(@Query("userId") userId: String): Flow<HttpResult<UserSignInBean>>

    @GET("/api/activity/center/get/red/packet")
    fun getRedPackage(@Query("userId") userId: String, @Query("taskId") taskId: Int): Flow<HttpResult<RedPackageBean>>

    @POST("/api/my/card/bag/rename/card/exchange")
    fun exchangeRenameCard(@Body body: RequestBody, @Header("Content-type") header: String = "application/json;charset=utf-8"): Flow<HttpResult<String>>

    @POST("/api/my/card/bag/del/comment/card/exchange")
    fun exchangeDeleteCard(@Body body: RequestBody, @Header("Content-type") header: String = "application/json;charset=utf-8"): Flow<HttpResult<String>>

    @POST("/api/my/card/bag/flower/buy")
    fun buyFlower(@Body body: RequestBody, @Header("Content-type") header: String = "application/json;charset=utf-8"): Flow<HttpResult<String>>

}
